<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Store into cache</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="yac.info.html">« Yac::info</a></li>
      <li style="float: right;"><a href="yac.setter.html">Yac::__set »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.yac.html">Yac</a></li>
    <li>Store into cache</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="yac.set" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yac::set</h1>
  <p class="verinfo">(PECL yac &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Yac::set</span> &mdash; <span class="dc-title">Store into cache</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yac.set-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>Yac::set</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$keys</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$ttl</code><span class="initializer"> = 0</span></span>): <span class="type">bool</span></div>

  <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="yac.add.html" class="methodname">Yac::add</a></span>(<span class="methodparam"><span class="type">array</span> <code class="parameter">$key_vals</code></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
    Add a item into cache, it the key is already exists, override it.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yac.set-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">keys</code></dt>

    <dd>

     <p class="para">
       <span class="type">string</span> key
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">value</code></dt>

    <dd>

     <p class="para">
      mixed value, All php value type could be stored except <a href="language.types.resource.html" class="link">资源(resource)</a>
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">ttl</code></dt>

    <dd>

     <p class="para">
      expire time
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-yac.set-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   the value self
  </p>
 </div>


</div></div></div></body></html>